<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<script src="http://unpkg.com/vue/dist/vue.js"></script>
	<script src="https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js"></script>
	<script type="text/javascript">
		window.onload = function(){
			var vm = new Vue({
				el:'#box',
				data:{
					msg:'Hello World!',
				},
				methods:{
					get:function(){
						//发送get请求
						this.$http.get('<?php echo WEB_ROOT ?>'+ 'test/index/captcha').then(function(res){
							alert(res.body);
						},function(){
							console.log('请求失败处理');
						});
					}
				}
			});
		}
	</script>
</head>
<body>
<div id="box">
	<input type="button" @click="get()" value="按钮">
</div>
</body>
</html>